import ActionSheet from '@opentiny/vue-action-sheet'
import Alert from '@opentiny/vue-alert'
import Amount from '@opentiny/vue-amount'
import Anchor from '@opentiny/vue-anchor'
import AsyncFlowchart from '@opentiny/vue-async-flowchart'
import Badge from '@opentiny/vue-badge'
import BaseSelect from '@opentiny/vue-base-select'
import Button from '@opentiny/vue-button'
import CalendarBar from '@opentiny/vue-calendar-bar'
import CalendarView from '@opentiny/vue-calendar-view'
import Card from '@opentiny/vue-card'
import CardGroup from '@opentiny/vue-card-group'
import Carousel from '@opentiny/vue-carousel'
import CarouselItem from '@opentiny/vue-carousel-item'
import Cascader from '@opentiny/vue-cascader'
import CascaderMenu from '@opentiny/vue-cascader-menu'
import CascaderMobile from '@opentiny/vue-cascader-mobile'
import CascaderNode from '@opentiny/vue-cascader-node'
import CascaderPanel from '@opentiny/vue-cascader-panel'
import CascaderSelect from '@opentiny/vue-cascader-select'
import CascaderView from '@opentiny/vue-cascader-view'
import Cell from '@opentiny/vue-cell'
import Checkbox from '@opentiny/vue-checkbox'
import CheckboxGroup from '@opentiny/vue-checkbox-group'
import Collapse from '@opentiny/vue-collapse'
import CollapseItem from '@opentiny/vue-collapse-item'
import ColumnListGroup from '@opentiny/vue-column-list-group'
import ColumnListItem from '@opentiny/vue-column-list-item'
import Grid from '@opentiny/vue-grid'
import GridSelect from '@opentiny/vue-grid-select'
import Currency from '@opentiny/vue-currency'
import DatePanel from '@opentiny/vue-date-panel'
import DateRange from '@opentiny/vue-date-range'
import DateTable from '@opentiny/vue-date-table'
import DialogBox from '@opentiny/vue-dialog-box'
import Divider from '@opentiny/vue-divider'
import Drawer from '@opentiny/vue-drawer'
import Dropdown from '@opentiny/vue-dropdown'
import DropdownItem from '@opentiny/vue-dropdown-item'
import DropdownMenu from '@opentiny/vue-dropdown-menu'
import Exception from '@opentiny/vue-exception'
import FileUpload from '@opentiny/vue-file-upload'
import Filter from '@opentiny/vue-filter'
import FilterBar from '@opentiny/vue-filter-bar'
import FloatingButton from '@opentiny/vue-floating-button'
import Flowchart from '@opentiny/vue-flowchart'
import FluentEditor from '@opentiny/vue-fluent-editor'
import Form from '@opentiny/vue-form'
import FormItem from '@opentiny/vue-form-item'
import Image from '@opentiny/vue-image'
import ImageViewer from '@opentiny/vue-image-viewer'
import Input from '@opentiny/vue-input'
import LoadList from '@opentiny/vue-load-list'
import Loading from '@opentiny/vue-loading'
import Menu from '@opentiny/vue-menu'
import Modal from '@opentiny/vue-modal'
import Numeric from '@opentiny/vue-numeric'
import Option from '@opentiny/vue-option'
import OptionGroup from '@opentiny/vue-option-group'
import Pager from '@opentiny/vue-pager'
import PagerItem from '@opentiny/vue-pager-item'
import Picker from '@opentiny/vue-picker'
import Popconfirm from '@opentiny/vue-popconfirm'
import Popover from '@opentiny/vue-popover'
import Progress from '@opentiny/vue-progress'
import PullRefresh from '@opentiny/vue-pull-refresh'
import Radio from '@opentiny/vue-radio'
import RadioButton from '@opentiny/vue-radio-button'
import RadioGroup from '@opentiny/vue-radio-group'
import Rate from '@opentiny/vue-rate'
import Record from '@opentiny/vue-record'
import Search from '@opentiny/vue-search'
import Select from '@opentiny/vue-select'
import SelectDropdown from '@opentiny/vue-select-dropdown'
import SelectMobile from '@opentiny/vue-select-mobile'
import SelectView from '@opentiny/vue-select-view'
import SelectedBox from '@opentiny/vue-selected-box'
import Signature from '@opentiny/vue-signature'
import Skeleton from '@opentiny/vue-skeleton'
import SkeletonItem from '@opentiny/vue-skeleton-item'
import Slider from '@opentiny/vue-slider'
import SliderButton from '@opentiny/vue-slider-button'
import SliderButtonGroup from '@opentiny/vue-slider-button-group'
import Space from '@opentiny/vue-space'
import StandardListItem from '@opentiny/vue-standard-list-item'
import Steps from '@opentiny/vue-steps'
import Sticky from '@opentiny/vue-sticky'
import Switch from '@opentiny/vue-switch'
import TabItem from '@opentiny/vue-tab-item'
import Tabbar from '@opentiny/vue-tabbar'
import TabbarItem from '@opentiny/vue-tabbar-item'
import Tabs from '@opentiny/vue-tabs'
import Tag from '@opentiny/vue-tag'
import TagGroup from '@opentiny/vue-tag-group'
import Time from '@opentiny/vue-time'
import TimeLine from '@opentiny/vue-time-line'
import TimePanel from '@opentiny/vue-time-panel'
import TimePickerMobile from '@opentiny/vue-time-picker-mobile'
import TimeSpinner from '@opentiny/vue-time-spinner'
import Tooltip from '@opentiny/vue-tooltip'
import Upload from '@opentiny/vue-upload'
import UploadDragger from '@opentiny/vue-upload-dragger'
import UploadList from '@opentiny/vue-upload-list'
import User from '@opentiny/vue-user'
import UserHead from '@opentiny/vue-user-head'
import UserHeadGroup from '@opentiny/vue-user-head-group'
import YearRange from '@opentiny/vue-year-range'
import YearTable from '@opentiny/vue-year-table'
import { $prefix } from '@opentiny/vue-common'

const components = [
  ActionSheet,
  Alert,
  Amount,
  Anchor,
  AsyncFlowchart,
  Badge,
  BaseSelect,
  Button,
  CalendarBar,
  CalendarView,
  Card,
  CardGroup,
  Carousel,
  CarouselItem,
  Cascader,
  CascaderMenu,
  CascaderMobile,
  CascaderNode,
  CascaderPanel,
  CascaderSelect,
  CascaderView,
  Cell,
  Checkbox,
  CheckboxGroup,
  Collapse,
  CollapseItem,
  ColumnListGroup,
  ColumnListItem,
  Grid,
  GridSelect,
  Currency,
  DatePanel,
  DateRange,
  DateTable,
  DialogBox,
  Divider,
  Drawer,
  Dropdown,
  DropdownItem,
  DropdownMenu,
  Exception,
  FileUpload,
  Filter,
  FilterBar,
  FloatingButton,
  Flowchart,
  FluentEditor,
  Form,
  FormItem,
  Image,
  ImageViewer,
  Input,
  LoadList,
  Loading,
  Menu,
  Modal,
  Numeric,
  Option,
  OptionGroup,
  Pager,
  PagerItem,
  Picker,
  Popconfirm,
  Popover,
  Progress,
  PullRefresh,
  Radio,
  RadioButton,
  RadioGroup,
  Rate,
  Record,
  Search,
  Select,
  SelectDropdown,
  SelectMobile,
  SelectView,
  SelectedBox,
  Signature,
  Skeleton,
  SkeletonItem,
  Slider,
  SliderButton,
  SliderButtonGroup,
  Space,
  StandardListItem,
  Steps,
  Sticky,
  Switch,
  TabItem,
  Tabbar,
  TabbarItem,
  Tabs,
  Tag,
  TagGroup,
  Time,
  TimeLine,
  TimePanel,
  TimePickerMobile,
  TimeSpinner,
  Tooltip,
  Upload,
  UploadDragger,
  UploadList,
  User,
  UserHead,
  UserHeadGroup,
  YearRange,
  YearTable
]

export const install = (app, opts = {}) => {
  const regex = new RegExp('^' + $prefix)

  const appProperties = app.config?.globalProperties || app.prototype
  appProperties.tiny_mode = { value: 'mobile-first' }

  components.forEach((component) => {
    const name = component.name
    const alias = opts.alias || opts.prefix

    if (typeof component.install !== 'function') return

    if (name && alias) {
      app.component(name.replace(regex, alias), component)
    } else {
      component.install(app)
    }
  })
}

export const version = '3.27.0'

export {
  ActionSheet,
  ActionSheet as TinyActionSheet,
  Alert,
  Alert as TinyAlert,
  Amount,
  Amount as TinyAmount,
  Anchor,
  Anchor as TinyAnchor,
  AsyncFlowchart,
  AsyncFlowchart as TinyAsyncFlowchart,
  Badge,
  Badge as TinyBadge,
  BaseSelect,
  BaseSelect as TinyBaseSelect,
  Button,
  Button as TinyButton,
  CalendarBar,
  CalendarBar as TinyCalendarBar,
  CalendarView,
  CalendarView as TinyCalendarView,
  Card,
  Card as TinyCard,
  CardGroup,
  CardGroup as TinyCardGroup,
  Carousel,
  Carousel as TinyCarousel,
  CarouselItem,
  CarouselItem as TinyCarouselItem,
  Cascader,
  Cascader as TinyCascader,
  CascaderMenu,
  CascaderMenu as TinyCascaderMenu,
  CascaderMobile,
  CascaderMobile as TinyCascaderMobile,
  CascaderNode,
  CascaderNode as TinyCascaderNode,
  CascaderPanel,
  CascaderPanel as TinyCascaderPanel,
  CascaderSelect,
  CascaderSelect as TinyCascaderSelect,
  CascaderView,
  CascaderView as TinyCascaderView,
  Cell,
  Cell as TinyCell,
  Checkbox,
  Checkbox as TinyCheckbox,
  CheckboxGroup,
  CheckboxGroup as TinyCheckboxGroup,
  Collapse,
  Collapse as TinyCollapse,
  CollapseItem,
  CollapseItem as TinyCollapseItem,
  ColumnListGroup,
  ColumnListGroup as TinyColumnListGroup,
  ColumnListItem,
  ColumnListItem as TinyColumnListItem,
  Grid,
  Grid as TinyGrid,
  GridSelect,
  GridSelect as TinyGridSelect,
  Currency,
  Currency as TinyCurrency,
  DatePanel,
  DatePanel as TinyDatePanel,
  DateRange,
  DateRange as TinyDateRange,
  DateTable,
  DateTable as TinyDateTable,
  DialogBox,
  DialogBox as TinyDialogBox,
  Divider,
  Divider as TinyDivider,
  Drawer,
  Drawer as TinyDrawer,
  Dropdown,
  Dropdown as TinyDropdown,
  DropdownItem,
  DropdownItem as TinyDropdownItem,
  DropdownMenu,
  DropdownMenu as TinyDropdownMenu,
  Exception,
  Exception as TinyException,
  FileUpload,
  FileUpload as TinyFileUpload,
  Filter,
  Filter as TinyFilter,
  FilterBar,
  FilterBar as TinyFilterBar,
  FloatingButton,
  FloatingButton as TinyFloatingButton,
  Flowchart,
  Flowchart as TinyFlowchart,
  FluentEditor,
  FluentEditor as TinyFluentEditor,
  Form,
  Form as TinyForm,
  FormItem,
  FormItem as TinyFormItem,
  Image,
  Image as TinyImage,
  ImageViewer,
  ImageViewer as TinyImageViewer,
  Input,
  Input as TinyInput,
  LoadList,
  LoadList as TinyLoadList,
  Loading,
  Loading as TinyLoading,
  Menu,
  Menu as TinyMenu,
  Modal,
  Modal as TinyModal,
  Numeric,
  Numeric as TinyNumeric,
  Option,
  Option as TinyOption,
  OptionGroup,
  OptionGroup as TinyOptionGroup,
  Pager,
  Pager as TinyPager,
  PagerItem,
  PagerItem as TinyPagerItem,
  Picker,
  Picker as TinyPicker,
  Popconfirm,
  Popconfirm as TinyPopconfirm,
  Popover,
  Popover as TinyPopover,
  Progress,
  Progress as TinyProgress,
  PullRefresh,
  PullRefresh as TinyPullRefresh,
  Radio,
  Radio as TinyRadio,
  RadioButton,
  RadioButton as TinyRadioButton,
  RadioGroup,
  RadioGroup as TinyRadioGroup,
  Rate,
  Rate as TinyRate,
  Record,
  Record as TinyRecord,
  Search,
  Search as TinySearch,
  Select,
  Select as TinySelect,
  SelectDropdown,
  SelectDropdown as TinySelectDropdown,
  SelectMobile,
  SelectMobile as TinySelectMobile,
  SelectView,
  SelectView as TinySelectView,
  SelectedBox,
  SelectedBox as TinySelectedBox,
  Signature,
  Signature as TinySignature,
  Skeleton,
  Skeleton as TinySkeleton,
  SkeletonItem,
  SkeletonItem as TinySkeletonItem,
  Slider,
  Slider as TinySlider,
  SliderButton,
  SliderButton as TinySliderButton,
  SliderButtonGroup,
  SliderButtonGroup as TinySliderButtonGroup,
  Space,
  Space as TinySpace,
  StandardListItem,
  StandardListItem as TinyStandardListItem,
  Steps,
  Steps as TinySteps,
  Sticky,
  Sticky as TinySticky,
  Switch,
  Switch as TinySwitch,
  TabItem,
  TabItem as TinyTabItem,
  Tabbar,
  Tabbar as TinyTabbar,
  TabbarItem,
  TabbarItem as TinyTabbarItem,
  Tabs,
  Tabs as TinyTabs,
  Tag,
  Tag as TinyTag,
  TagGroup,
  TagGroup as TinyTagGroup,
  Time,
  Time as TinyTime,
  TimeLine,
  TimeLine as TinyTimeLine,
  TimePanel,
  TimePanel as TinyTimePanel,
  TimePickerMobile,
  TimePickerMobile as TinyTimePickerMobile,
  TimeSpinner,
  TimeSpinner as TinyTimeSpinner,
  Tooltip,
  Tooltip as TinyTooltip,
  Upload,
  Upload as TinyUpload,
  UploadDragger,
  UploadDragger as TinyUploadDragger,
  UploadList,
  UploadList as TinyUploadList,
  User,
  User as TinyUser,
  UserHead,
  UserHead as TinyUserHead,
  UserHeadGroup,
  UserHeadGroup as TinyUserHeadGroup,
  YearRange,
  YearRange as TinyYearRange,
  YearTable,
  YearTable as TinyYearTable
}

export default {
  ActionSheet,
  TinyActionSheet: ActionSheet,
  Alert,
  TinyAlert: Alert,
  Amount,
  TinyAmount: Amount,
  Anchor,
  TinyAnchor: Anchor,
  AsyncFlowchart,
  TinyAsyncFlowchart: AsyncFlowchart,
  Badge,
  TinyBadge: Badge,
  BaseSelect,
  TinyBaseSelect: BaseSelect,
  Button,
  TinyButton: Button,
  CalendarBar,
  TinyCalendarBar: CalendarBar,
  CalendarView,
  TinyCalendarView: CalendarView,
  Card,
  TinyCard: Card,
  CardGroup,
  TinyCardGroup: CardGroup,
  Carousel,
  TinyCarousel: Carousel,
  CarouselItem,
  TinyCarouselItem: CarouselItem,
  Cascader,
  TinyCascader: Cascader,
  CascaderMenu,
  TinyCascaderMenu: CascaderMenu,
  CascaderMobile,
  TinyCascaderMobile: CascaderMobile,
  CascaderNode,
  TinyCascaderNode: CascaderNode,
  CascaderPanel,
  TinyCascaderPanel: CascaderPanel,
  CascaderSelect,
  TinyCascaderSelect: CascaderSelect,
  CascaderView,
  TinyCascaderView: CascaderView,
  Cell,
  TinyCell: Cell,
  Checkbox,
  TinyCheckbox: Checkbox,
  CheckboxGroup,
  TinyCheckboxGroup: CheckboxGroup,
  Collapse,
  TinyCollapse: Collapse,
  CollapseItem,
  TinyCollapseItem: CollapseItem,
  ColumnListGroup,
  TinyColumnListGroup: ColumnListGroup,
  ColumnListItem,
  TinyColumnListItem: ColumnListItem,
  Currency,
  TinyCurrency: Currency,
  DatePanel,
  TinyDatePanel: DatePanel,
  DateRange,
  TinyDateRange: DateRange,
  DateTable,
  TinyDateTable: DateTable,
  DialogBox,
  TinyDialogBox: DialogBox,
  Divider,
  TinyDivider: Divider,
  Drawer,
  TinyDrawer: Drawer,
  Dropdown,
  TinyDropdown: Dropdown,
  DropdownItem,
  TinyDropdownItem: DropdownItem,
  DropdownMenu,
  TinyDropdownMenu: DropdownMenu,
  Exception,
  TinyException: Exception,
  FileUpload,
  TinyFileUpload: FileUpload,
  Filter,
  TinyFilter: Filter,
  FilterBar,
  TinyFilterBar: FilterBar,
  FloatingButton,
  TinyFloatingButton: FloatingButton,
  Flowchart,
  TinyFlowchart: Flowchart,
  FluentEditor,
  TinyFluentEditor: FluentEditor,
  Form,
  TinyForm: Form,
  FormItem,
  TinyFormItem: FormItem,
  Image,
  TinyImage: Image,
  ImageViewer,
  TinyImageViewer: ImageViewer,
  Input,
  TinyInput: Input,
  LoadList,
  TinyLoadList: LoadList,
  Loading,
  TinyLoading: Loading,
  Menu,
  TinyMenu: Menu,
  Modal,
  TinyModal: Modal,
  Numeric,
  TinyNumeric: Numeric,
  Option,
  TinyOption: Option,
  OptionGroup,
  TinyOptionGroup: OptionGroup,
  Pager,
  TinyPager: Pager,
  PagerItem,
  TinyPagerItem: PagerItem,
  Picker,
  TinyPicker: Picker,
  Popconfirm,
  TinyPopconfirm: Popconfirm,
  Popover,
  TinyPopover: Popover,
  Progress,
  TinyProgress: Progress,
  PullRefresh,
  TinyPullRefresh: PullRefresh,
  Radio,
  TinyRadio: Radio,
  RadioButton,
  TinyRadioButton: RadioButton,
  RadioGroup,
  TinyRadioGroup: RadioGroup,
  Rate,
  TinyRate: Rate,
  Record,
  TinyRecord: Record,
  Search,
  TinySearch: Search,
  Select,
  TinySelect: Select,
  SelectDropdown,
  TinySelectDropdown: SelectDropdown,
  SelectMobile,
  TinySelectMobile: SelectMobile,
  SelectView,
  TinySelectView: SelectView,
  SelectedBox,
  TinySelectedBox: SelectedBox,
  Signature,
  TinySignature: Signature,
  Skeleton,
  TinySkeleton: Skeleton,
  SkeletonItem,
  TinySkeletonItem: SkeletonItem,
  Slider,
  TinySlider: Slider,
  SliderButton,
  TinySliderButton: SliderButton,
  SliderButtonGroup,
  TinySliderButtonGroup: SliderButtonGroup,
  Space,
  TinySpace: Space,
  StandardListItem,
  TinyStandardListItem: StandardListItem,
  Steps,
  TinySteps: Steps,
  Sticky,
  TinySticky: Sticky,
  Switch,
  TinySwitch: Switch,
  TabItem,
  TinyTabItem: TabItem,
  Tabbar,
  TinyTabbar: Tabbar,
  TabbarItem,
  TinyTabbarItem: TabbarItem,
  Tabs,
  TinyTabs: Tabs,
  Tag,
  TinyTag: Tag,
  TagGroup,
  TinyTagGroup: TagGroup,
  Time,
  TinyTime: Time,
  TimeLine,
  TinyTimeLine: TimeLine,
  TimePanel,
  TinyTimePanel: TimePanel,
  TimePickerMobile,
  TinyTimePickerMobile: TimePickerMobile,
  TimeSpinner,
  TinyTimeSpinner: TimeSpinner,
  Tooltip,
  TinyTooltip: Tooltip,
  Upload,
  TinyUpload: Upload,
  UploadDragger,
  TinyUploadDragger: UploadDragger,
  UploadList,
  TinyUploadList: UploadList,
  User,
  TinyUser: User,
  UserHead,
  TinyUserHead: UserHead,
  UserHeadGroup,
  TinyUserHeadGroup: UserHeadGroup,
  YearRange,
  TinyYearRange: YearRange,
  YearTable,
  TinyYearTable: YearTable,
  install
} as any
